package com.wsoft.hr.pm.controller;

import com.wsoft.hr.pm.query.activity.member.template.score.MemberTemplateScoreSaveQuery;
import com.wsoft.hr.pm.service.IHrPmMemberTemplateScoreService;
import com.wsoft.response.ResponseResult;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * 人员考核评分表 前端控制器
 * @author zhanggukai
 * @since 2025年03月04日 10:38:00
 */
@RestController
@Tag(name = "人员考核评分")
@RequestMapping("/hr/pm/member/template/score")
public class HrPmMemberTemplateScoreController {

    @Resource
    private IHrPmMemberTemplateScoreService scoreService;
    @Operation(summary = "考核评分", description = "考核评分")
    @PostMapping("/assessScore")
    public ResponseResult assessScore(@RequestBody @Valid MemberTemplateScoreSaveQuery query) {
         scoreService.saveMemberTemplateScore(query);
         return ResponseResult.success("[sys.msg.success]");
    }

    @Operation(summary = "考核评分历史", description = "考核评分历史")
    @GetMapping("/getScoreHis")
    public ResponseResult getScoreHis(@RequestParam("memberTemplateId") Long memberTemplateId) {
        return ResponseResult.success(scoreService.getScoreHis(memberTemplateId));
    }
}
